package com.wjerp.tplus.server.common.constant;

/**
 * 发票校验状态枚举
 * @author lishuailei
 */
public enum InvoiceCheckStatus {
    UN_CHECK(0,"未查验"),
    SUCCESS(1,"查验成功"),
    FAIL(2,"查验失败"),
    FAIL_BY_NAME(3,"查验成功,但是企业名称不匹配");


    private Integer code;
    private String message;

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


    /**
     * Instantiates a new error detail.
     *
     * @param code the code
     * @param message the message
     */
    private InvoiceCheckStatus(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static InvoiceCheckStatus resolve(Integer code) {
        for (InvoiceCheckStatus item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }

}
